<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<input type="hidden" id="rpnnSave" value="${rpnnSave}"/>
<input type="hidden" id="rpn" value="${rpn}"/>
<input type="hidden" id="rpNum" value="${rpNum}"/>
<input type="hidden" id="rpc" value="${rpc}"/>
<input type="hidden" id="unc" value="${unc}"/>
<script language="JavaScript" type="text/JavaScript">

$(document).ready(function(){
    var rs = document.getElementById("rpnnSave").value;
    var pn = document.getElementById("rpn").value;
    var pNum = document.getElementById("rpNum").value;
    var pc = document.getElementById("rpc").value;
     var nc = document.getElementById("unc").value;
    if(rs == "不成功"){
    	alert(pNum+" "+pn+" "+pc+" "+nc+" 分区保存失败！请检查后再保存！");
    }
	});
</script>

<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a title=""  class="edit"
			href="pricemanager/Channel/EditStartPartition.html" target="navTab" rel="EditStartPartition"><span>修改起始分区</span></a></li>
			<li class="line">line</li>
			<li><a class="add" href="<%=basePath%>partition_getChannelBean.action?" target="navTab" title="导入起始分区"
			rel="ImportStartPartition"><span>导入起始分区</span></a></li>
			<li><a  title=""  class="edit"
			href="pricemanager/Channel/StartPartitionTable.html" target="navTab" rel="StartPartitionTable"><span>起始分区表</span></a></li>
			<li class="line">line</li>
			<li><a class="icon" href="demo/common/dwz-team.xls" target="dwzExport" targetType="navTab" title="是要导出分区表吗?"><span>导出分区表</span></a></li>
			<li><a class="icon" href="demo/common/dwz-team.xls" target="dwzExport" targetType="navTab" title="是要检查分区表吗?"><span>检查分区表</span></a></li>
		</ul>
	</div>
	<div class="divider"></div>
	<form method="post" action="<%=basePath%>partition_saveImportPartition.action" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone)">
	<input type="hidden" name="partitionClass" value="ST"/>
	<input type="hidden" name="Dizhi" value="pricemanager/Channel/EditImportStartPartition.jsp"/>
	<label>&nbsp;&nbsp;渠道名称：</label>
			<input name="pChannel_number" type="hidden" value="${pChannel_number}" />
			<input name="pChannelABean.channel.PChannelName" class="required" type="text" size="30" value="${pChannelABean.channel.PChannelName}"  readonly="true"/>
	<div class="divider"></div>
	<div layoutH="108">
	<table>
			<tr>
				<td><label class="contentTitle" style="font-size: 14; color: blue;">分区号:↓</label></td>
				<td><label class="contentTitle" style="font-size: 14; color: blue;">分区名:↓</label></td>
				<td><label class="contentTitle" style="font-size: 14; color: blue;">起始地:↓</label></td>
				<td><label class="contentTitle" style="font-size: 14; color: blue;">未选中:↓</label></td>
				<td><label class="contentTitle" style="font-size: 14; color: blue;">起始地:↓</label></td>
			</tr>
			
			<c:forEach items="${partitions}" var="partition">
				<tr target="sid_user" rel="1">
				<td width="110">
					<input name="partitionNumber" class="required" type="text" size="14" value="${partition.PPartitionNumber }" readonly="readonly"/>
					<c:forEach items="${repeatPartitionNumber}" var="rPNum">
						<c:if test="${partition.PPartitionNumber == rPNum}">
							<font color="red">已存在或重复</font>
						</c:if>
					</c:forEach>
				</td>
				<td width="110">
					<input name="partitionName" class="required" type="text" size="14" value="${partition.PPartitionName }"/>
					<c:forEach items="${repeatPartitionName}" var="rPName">
						<c:if test="${partition.PPartitionName == rPName}">
							<font color="red">已存在或重复</font>
						</c:if>
					</c:forEach>
				</td>
				<td width="210">
					<textarea name="clientCountryCodp" class="required" cols="25" rows="6"><c:forEach items="${partitionLines}" var="partitionLine"><c:if test="${partition.PPartitionNumber ==partitionLine.PPartitionNumber }">${partitionLine.clientCountryCode },</c:if></c:forEach></textarea>
				</td>
				<td width="210">
					<textarea readonly="readonly" cols="25" rows="6"><c:forEach items="${unls}" var="unl"><c:if test="${partition.PPartitionNumber ==unl.PPartitionNumber }">${unl.clientCountryCode },</c:if></c:forEach></textarea>
				</td>
				<td width="">
					<a target="ajaxTodo" href="pricemanager/Channel/CityTree.jsp" class="btnEdit" rel="CityTree">起始地</a>
				</td>
			</tr>
			</c:forEach>
	</table>
	</div>
	<div class="formBar">
			<ul>
				<!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
 </form>	
</div>
